$(function(){
	$('#tt').datagrid({
		url:'/searchData/getImsiRetentPageList'
	});
	
});

function doSearch(){
	var type=$('#typeId').combobox('getValue');
	var url="/searchData/getImsiRetentPageList";
	if(type=='2'){
		url="/searchData/getImsiRetentLogPageList";
	}
	
	var mark=$('#markId').val();
	var imsi=$('#imsiId').val();
	var imei=$('#imeiId').val();
	var currentDate=$('#currentDateId').datebox('getValue');
	
	$('#tt').datagrid({
		url:url,
		queryParams:{
			mark:mark,
			imsi:imsi,
			imei:imei,
			currentDate:currentDate
		}
	});
	$('#tt').datagrid('unselectAll');
}

function GetDateDiff(startTime, endTime, diffType) {
    //将计算间隔类性字符转换为小写
    diffType = diffType.toLowerCase();
    var sTime = new Date(startTime);      //开始时间
    var eTime = new Date(endTime);  //结束时间
    
    var divNum = 1;
    switch (diffType) {
        case "second":
            divNum = 1000;
            break;
        case "minute":
            divNum = 1000 * 60;
            break;
        case "hour":
            divNum = 1000 * 3600;
            break;
        case "day":
            divNum = 1000 * 3600 * 24;
            break;
        default:
            break;
    }
    return parseInt((sTime.getTime() - eTime.getTime()) / parseInt(divNum));
}

